import axios from 'services/axiosConfig.js'
import { ShopApi } from 'services/apiConfig.js'

class ShopService {
  getShopByUserId (userId) {
    return axios({
      method: ShopApi.getShopByUserId.method,
      url: ShopApi.getShopByUserId.url + '?Shop.userid=' + userId
    })
  }
  getShopById (id) {
    return axios({
      method: ShopApi.getShopById.method,
      url: ShopApi.getShopById.url + '?Shop.id=' + id
    })
  }
  getShopsByName (shopName) {
    return axios({
      method: ShopApi.getShopsByName.method,
      url: ShopApi.getShopsByName.url + '?Shop.name=(like)' + shopName
    })
  }
  addShop (shop) {
    return axios({
      method: ShopApi.addShop.method,
      url: ShopApi.addShop.url,
      data: shop
    })
  }
}

export default new ShopService()
